package com.eshop.enums;

import java.util.stream.Stream;

public enum OrderInfoEnum
{
    STATUS_0(Integer.valueOf(0), "默认"), 
    STATUS_1(Integer.valueOf(1), "待收货"), 
    STATUS_2(Integer.valueOf(2), "已收货"), 
    STATUS_3(Integer.valueOf(3), "已完成"), 
    PAY_STATUS_0(Integer.valueOf(0), "未支付"), 
    PAY_STATUS_1(Integer.valueOf(1), "已支付"), 
    REFUND_STATUS_0(Integer.valueOf(0), "正常"), 
    REFUND_STATUS_1(Integer.valueOf(1), "退款中"), 
    REFUND_STATUS_2(Integer.valueOf(2), "已退款"), 
    BARGAIN_STATUS_1(Integer.valueOf(1), "参与中"), 
    BARGAIN_STATUS_2(Integer.valueOf(2), "参与失败"), 
    BARGAIN_STATUS_3(Integer.valueOf(3), "参与成功"), 
    PINK_STATUS_1(Integer.valueOf(1), "进行中"), 
    PINK_STATUS_2(Integer.valueOf(2), "已完成"), 
    PINK_STATUS_3(Integer.valueOf(3), "未完成"), 
    PINK_REFUND_STATUS_0(Integer.valueOf(0), "拼团正常"), 
    PINK_REFUND_STATUS_1(Integer.valueOf(1), "拼团已退款"), 
    CANCEL_STATUS_0(Integer.valueOf(0), "正常"), 
    CANCEL_STATUS_1(Integer.valueOf(1), "已取消"), 
    CONFIRM_STATUS_0(Integer.valueOf(0), "正常"), 
    CONFIRM_STATUS_1(Integer.valueOf(1), "确认"), 
    PAY_CHANNEL_0(Integer.valueOf(0), "公众号/H5支付渠道"), 
    PAY_CHANNEL_1(Integer.valueOf(1), "小程序支付渠道"), 
    SHIPPIING_TYPE_1(Integer.valueOf(1), "快递"), 
    SHIPPIING_TYPE_2(Integer.valueOf(2), "门店自提");
    
    private Integer value;
    private String desc;
    
    public static OrderInfoEnum toType(final int value) {
        return Stream.of(values()).filter(p -> p.value == value).findAny().orElse(null);
    }
    
    public Integer getValue() {
        return this.value;
    }
    
    public String getDesc() {
        return this.desc;
    }
    
    private OrderInfoEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
}
